<template>
  <h1 class="iamtestSrcFile2">我是testSrcFile2</h1>
  <h5>看看changTime是不是响应式的{{ changTime }}</h5>
  <el-switch v-model="val" />
  <el-badge :value="changTime" class="item">
    <el-button @click="showChangeTimeVal">记录点了几下转换</el-button>
  </el-badge>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
let val = ref(false)
let changTime: number = 0
watch(val, () => {
  changTime++
  console.log('val发生变化了=>', val.value)
})
function showChangeTimeVal() {
  console.log('changTime=>', changTime)
}
</script>
<style scoped lang="scss">
.iamtestSrcFile2 {
  color: brown;
}
</style>
